package com.hk.service.sys.impl;

import com.hk.commons.ConstantParm;
import com.hk.commons.entity.Parameter;
import com.hk.service.order.IParameter;
import com.hk.service.sys.ICacheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *缓存
 * @author Evan
 * @date 2017/11/29
 */
@Service
public class CacheServiceImpl implements ICacheService {

    @Autowired
    private IParameter parameterService;

    @Override
    public int getExpireSecond() {
        int result = 30;

        Parameter param = parameterService.getByName(ConstantParm.ORDER_TOTAL_CACHE_EXPIRE);

        if (param == null || param.getValue01() == null) {
            return result;
        }

        result = Integer.valueOf(param.getValue01());

        return result;
    }
}
